package com.oop.jihe.map;

import java.util.HashMap;
import java.util.Map;

public class Tes_map_method {
    public static void main(String[] args) {
        Map map = new HashMap();
        map.put("no1","老林");//k-v
        map.put("no2","查找后");//k-v
        //笔记34
        map.put("no1","林佳烁");//相同k，替换
        map.put("no3","林佳烁");//相同
        //笔记5
        map.put(null,null);//k-v
        map.put(null,"abc");//替换
        map.put("no4",null);
        map.put("no5",null);
        //笔记6
        map.put(1,"赵薇");
        //笔记7
        System.out.println(map.get("no1"));
        System.out.println("map=" + map);

        map.remove(null);
        System.out.println("map=" + map);

        Object val = map.get("no1");
        System.out.println("val=" + val);

        System.out.println("k-v =" + map.size());

        System.out.println(map.isEmpty());

        map.clear();

        System.out.println("结果=" + map.containsKey("no5"));
        //_________________________________________________________________
        int a = 9;
        Map<String,Object> map1 = new HashMap<>();
        map1.put("1","xx");
        map1.put("结合","据技术");
        map1.put("asd",map);
        map1.put("a",a);
        boolean a1 = map1.containsKey("1");
        System.out.println(a1);

        Map<Integer,Object> map2 = new HashMap<>();
        map2.put(a,"fssv");

        System.out.println(map1);
        System.out.println(map2);

    }
}
